import request from '@/config/axios'
import { RetrieveUserParams } from './types'
import { UserItem } from '@/views/SysManage/types/user'

export const RetrieveUser = (params: RetrieveUserParams): Promise<IResponse> => {
  return request.get({ url: '/v1/admin/user/retrieve/', params })
}
// 创建用户
export const CreateNewUser = async (data: UserItem): Promise<IResponse> => {
  return request.post({ url: '/v1/admin/user/create/', data })
}
// 修改用户信息
export const UpdateRowUser = async (data: UserItem): Promise<IResponse> => {
  return request.put({ url: '/v1/admin/user/update/', data })
}
// 请求登录日志
export const RetrieveUserLoginLog = async (uid: number, page: number): Promise<IResponse> => {
  return request.get({ url: '/v1/admin/user/loginLog/', params: { uid, page } })
}
